package org.dtrd.modules.archive.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.dtrd.modules.patient.entity.bean.PatientBasicAndFamilyInfo;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveBasic;
import org.dtrd.modules.patient.entity.request.PatientRequest;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

@Repository
public interface DtrdEntRdArchiveBasicMapper extends BaseMapper<DtrdEntRdArchiveBasic> {

    /**
     * 通过 patientId 逻辑删除记录
     */
    void deleteByPatientIds(@Param("patientIds") Set<Integer> patientId);

    /**
     * 通过指定条件查询数据
     */
    List<PatientBasicAndFamilyInfo> selectPatientBasicInfoByRequest(@Param("request") PatientRequest request);

    /**
     * 获取患者档案百分比
     *
     * @param patientId patientId
     * @return 百分比
     */
    Integer selectPatientArchiveInfoPercent(@Param("patientId") Integer patientId);

    /**
     * 查询患者档案基础信息
     *
     * @param patientId
     * @return
     */
    DtrdEntRdArchiveBasic getPatientBasicInfoByPatientId(@Param("patientId") Integer patientId);
}